package com.zdp.dubbo.simulate.provider;

import com.zdp.dubbo.simulate.framework.Protocol;
import com.zdp.dubbo.simulate.framework.ProtocolFactory;
import com.zdp.dubbo.simulate.framework.URL;
import com.zdp.dubbo.simulate.framework.protocol.http.HttpServer;
import com.zdp.dubbo.simulate.framework.register.LocalRegister;
import com.zdp.dubbo.simulate.framework.register.RemoteMapRegister;
import com.zdp.dubbo.simulate.provider.api.HelloService;
import com.zdp.dubbo.simulate.provider.impl.HelloServiceImpl;

/**
 * @author ZhengDp
 * @Date 2023/6/4 12:06
 */
public class Provider {
    public static void main(String[] args) {
        LocalRegister.register(HelloService.class.getName(),"1", HelloServiceImpl.class);
        URL url = new URL("localhost","8080");
        RemoteMapRegister.register(HelloService.class.getName(),url);
        Protocol protocol = ProtocolFactory.getProtocol();
        protocol.start(url);
    }
}
